-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added querySystemLimits for CSI spec 1.6 #86
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable names in go follow some specific naming conventions example systemLimit etc.
system_limit.go
Outdated
|
||
func (c *Client) GetSystemLimits() (syslimit *types.Limit, err error) { | ||
defer TimeSpent("GetSystemLimits", time.Now()) | ||
var e emptyBody |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here instead of e give some meaningful variable name
system_limit.go
Outdated
return nil, err | ||
} | ||
|
||
return syslimit, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
systemLimits
system_limit.go
Outdated
// GetMaxVol returns max volume size in GB | ||
func (c *Client) GetMaxVol() (sys string, err error) { | ||
defer TimeSpent("GetMaxVol", time.Now()) | ||
maxlimitType, err := c.GetSystemLimits() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
systemLimits
types/v1/types.go
Outdated
} | ||
|
||
// SystemLimitEntryList defines struct for system limit entryList | ||
type Limit struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will be good to rename it to QuerySystemLimitsResponse
types/v1/types.go
Outdated
@@ -1738,3 +1738,15 @@ type MDMQueueCommandDetails struct { | |||
TargetEntityIdentifier string `json:"targetEntityIdentifier,omitempty"` | |||
AllowedPhase string `json:"allowedPhase,omitempty"` | |||
} | |||
|
|||
// QuerySystemLimits defines struct for query system limits | |||
type QuerySystemLimits struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename it to SystemLimit
system_limit.go
Outdated
types "github.com/dell/goscaleio/types/v1" | ||
) | ||
|
||
type QuerySystemLimitsParam struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this to types/v1 types.go because all the types are defined there only
system_limit.go
Outdated
// GetMaxVol returns max volume size in GB | ||
func (c *Client) GetMaxVol() (systemLimits string, err error) { | ||
defer TimeSpent("GetMaxVol", time.Now()) | ||
maxLimitType, err := c.GetSystemLimits() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the variable name to systemLimits
system_limit.go
Outdated
return "", err | ||
} | ||
|
||
for _, systemType := range maxLimitType.SystemLimitEntryList { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
systemLimit
system_limit.go
Outdated
|
||
for _, systemType := range maxLimitType.SystemLimitEntryList { | ||
|
||
if systemType.Type == "volumeSizeGb" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
systemLimit.Type
system_limit.go
Outdated
} | ||
|
||
// GetMaxVol returns max volume size in GB | ||
func (c *Client) GetMaxVol() (systemLimits string, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should return MaxVolumeSize not systemLimits change it.
please re run the integration and unit tests to make sure nothing is breaking |
Description
Added querySystemLimits for CSI spec 1.6
GitHub Issues
List the GitHub issues impacted by this PR:
Checklist:
How Has This Been Tested?
Tested the changes using integartion test and unit test
{"maxVal":"512","description":"Total Number of concurrent Move Pairs operations","type":"concurrentMovePairsOperations"},{"maxVal":"65536","minVal":"8","description":"Single replication volume size in GB","type":"replicationVolumeSizeGb"},{"maxVal":"262143","description":"Number of mappings between volumes and hosts","type":"replicationPairsPerReplicationConsistencyGroup"},{"maxVal":"512","description":"Number of host connections (IO controllers) per SDT","type":"ioControllersPerSdt"},{"maxVal":"128","description":"Depth of IO controller queue","type":"ioControllersQueueDepth"},{"maxVal":"32","description":"Number of IO controller queues","type":"ioControllersNumQueues"},{"maxVal":"8","description":"Number of paths per volume","type":"pathsPerVolume"},{"maxVal":"16","description":"Number of connections per host per protection domain","type":"connectionsPerHostPerProtectionDomain"},{"maxVal":"65519","description":"Number of host connections (IO controllers) per SYSTEM","type":"ioControllersPerSystem"}]}
0
1048576
max volume size in volumeSizeGb 1048576